package com.zhaowei.allinpay;


import com.zhaowei.allinpay.member.*;
import com.zhaowei.allinpay.merchant.GetCheckAccountFileHandler;
import com.zhaowei.allinpay.merchant.QueryReserveFundBalanceHandler;
import com.zhaowei.allinpay.order.*;

public class DemoHandlerFactory {

    public IDemoHandler getHandler(String serviceName, String methodName) throws Exception {
        if ("MemberService".equals(serviceName)) {
            switch (methodName) {
                case "createMember":
                    return new CreateMemberHandler();
                case "sendVerificationCode":
                    return new SendVerificationCodeHandler();
                case "bindPhone":
                    return new BindPhoneHandler();
                case "changeBindPhone":
                    return new ChangeBindPhoneHandler();
                case "setRealName":
                    return new SetRealNameHandler();
                case "setCompanyInfo":
                    return new SetCompanyInfoHandler();
                case "getMemberInfo":
                    return new GetMemberInfoHandler();
                case "getBankCardBin":
                    return new GetBankCardBinHandler();
                case "applyBindBankCard":
                    return new ApplyBindBankCardHandler();
                case "bindBankCard":
                    return new BindBankCardHandler();
                case "setSafeCard":
                    return new SetSafeCardHandler();
                case "queryBankCard":
                    return new QueryBankCardHandler();
                case "unbindBankCard":
                    return new UnbindBankCardHandler();
                case "lockMember":
                    return new LockMemberHandler();
                case "unlockMember":
                    return new UnlockMemberHandler();
                default:
                    throw new Exception("调用方法名称不正确，输入的调用方法名称为" + methodName);
            }
        } else if ("OrderService".equals(serviceName)) {
            switch (methodName) {
                case "depositApply":
                    return new DepositApplyHandler();
                case "withdrawApply":
                    return new WithdrawApplyHandler();
                case "consumeApply":
                    return new ConsumeApplyHandler();
                case "agentCollectApplySimplify":
                    return new AgentCollectApplySimplifyHandler();
                case "signalAgentPaySimplify":
                    return new SignalAgentPaySimplifyHandler();
                case "batchAgentPaySimplify":
                    return new BatchAgentPaySimplifyHandler();
                case "pay":
                    return new PayHandler();
                case "entryGoods":
                    return new EntryGoodsHandler();
                case "queryModifyGoods":
                    return new QueryModifyGoodsHandler();
                case "freezeMoney":
                    return new FreezeMoneyHandler();
                case "unfreezeMoney":
                    return new UnfreezeMoneyHandler();
                case "refund":
                    return new RefundHandler();
                case "failureBidRefund":
                    return new FailureBidRefundHandler();
                case "applicationTransfer":
                    return new ApplicationTransferHandler();
                case "queryBalance":
                    return new QueryBalanceHandler();
                case "getOrderDetail":
                    return new GetOrderDetailHandler();
                case "queryInExpDetail":
                    return new QueryInExpDetailHandler();
                default:
                    throw new Exception("调用方法名称不正确，输入的调用方法名称为" + methodName);
            }

        } else if ("MerchantService".equals(serviceName)) {
            switch (methodName) {
                case "queryReserveFundBalance":
                    return new QueryReserveFundBalanceHandler();
                case "getCheckAccountFile":
                    return new GetCheckAccountFileHandler();
                default:
                    throw new Exception("调用方法名称不正确，输入的调用方法名称为" + methodName);
            }
        } else {
            throw new Exception("服务对象名称不正确，输入的服务对象名称为" + serviceName);
        }
    }

}
